Assignemnt #60 and 58th program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 58th Program
///File name: Fift8Prog.java
///Date Finished:11/12/2015
import java.util.Scanner;
public class Fift8Prog
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int pin = 12345;
System.out.println( "WELCOME TO THE BANK" );
System.out.println( "ENTER YOUR PIN:" );
int entry = keyboard.nextInt();
while ( entry != pin )
{
System.out.println( "\nINCORRECT PIN. TRY IT AGAIN." );
System.out.println( "ENTER YOUR PIN:" );
entry = keyboard.nextInt();
}
System.out.println( "\nPIN ACCEPTED. YOU NOW HAVE ACCESS TO YOUR ACCOUNT." );
}
}
Picture of the output